use clap::Parser;
mod cli;
mod database;
mod llm;
mod embeddings;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
    println!("Hello, world!");

    let args = cli::Cli::parse();
    match args.command {
        cli::Commands::Ask {query} => {
            let references = database::retrieve(&query).await?;
            let answer = llm::answer_with_context(&query, references).await?;
            println!("🤖 {}", answer);
    },
        cli::Commands::Remember {content} => {
            database::insert(&content).await?;
            println!("已记住: {}", content);
        }
    }
    Ok(())
}
